home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / VBsource-keygen-gpscrackme2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-11  |  4.8 KB  |  131 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Keygen for Crackme 2 (gPs)"
  5.    ClientHeight    =   3195
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4050
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    ScaleHeight     =   3195
  12.    ScaleWidth      =   4050
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin VB.CommandButton Command1 
  15.       Caption         =   "Calculate"
  16.       Default         =   -1  'True
  17.       Height          =   375
  18.       Left            =   1080
  19.       TabIndex        =   3
  20.       Top             =   2640
  21.       Width           =   1935
  22.    End
  23.    Begin VB.TextBox Vorname 
  24.       Height          =   375
  25.       Left            =   960
  26.       MaxLength       =   30
  27.       TabIndex        =   1
  28.       Top             =   1320
  29.       Width           =   3015
  30.    End
  31.    Begin VB.TextBox Name1 
  32.       Height          =   375
  33.       Left            =   960
  34.       MaxLength       =   30
  35.       TabIndex        =   0
  36.       Top             =   720
  37.       Width           =   3015
  38.    End
  39.    Begin VB.Label Label4 
  40.       Caption         =   "Keygen for Crackme 2 (gPs)"
  41.       BeginProperty Font 
  42.          Name            =   "MS Sans Serif"
  43.          Size            =   9.75
  44.          Charset         =   0
  45.          Weight          =   700
  46.          Underline       =   0   'False
  47.          Italic          =   0   'False
  48.          Strikethrough   =   0   'False
  49.       EndProperty
  50.       Height          =   495
  51.       Left            =   120
  52.       TabIndex        =   7
  53.       Top             =   120
  54.       Width           =   3975
  55.    End
  56.    Begin VB.Label Label3 
  57.       Caption         =   "Code :"
  58.       Height          =   375
  59.       Left            =   360
  60.       TabIndex        =   6
  61.       Top             =   2040
  62.       Width           =   495
  63.    End
  64.    Begin VB.Label Label2 
  65.       Caption         =   "Vorname :"
  66.       Height          =   375
  67.       Left            =   120
  68.       TabIndex        =   5
  69.       Top             =   1320
  70.       Width           =   855
  71.    End
  72.    Begin VB.Label Label1 
  73.       Caption         =   "Name :"
  74.       Height          =   375
  75.       Left            =   360
  76.       TabIndex        =   4
  77.       Top             =   720
  78.       Width           =   615
  79.    End
  80.    Begin VB.Label Code 
  81.       Appearance      =   0  'Flat
  82.       BackColor       =   &H80000005&
  83.       ForeColor       =   &H80000008&
  84.       Height          =   375
  85.       Left            =   960
  86.       TabIndex        =   2
  87.       Top             =   2040
  88.       Width           =   3015
  89.    End
  90. Attribute VB_Name = "Form1"
  91. Attribute VB_GlobalNameSpace = False
  92. Attribute VB_Creatable = False
  93. Attribute VB_PredeclaredId = True
  94. Attribute VB_Exposed = False
  95. Dim UserName, UserVorName As String
  96. Private Sub Code_Click()
  97.     Clipboard.SetText Code.Caption
  98. End Sub
  99. Private Sub Command1_Click()
  100. UserName = Name1.Text
  101. UserVorName = Vorname.Text
  102. 'check : name here ?
  103. If Trim(Name1.Text) = "" Then
  104.     MsgBox "Please enter a name.", vbOKOnly, "Keygen for Crackme 2 by fLAIEr (gPs)" ' display a messagebox
  105.     Exit Sub    'Exit the sub
  106. End If
  107. ' the temporary code is divided in 5 parts
  108. X1 = Len(UserName) * 3 * Len(UserVorName) * 5 * 5 * 6 / 6   ' 1st part
  109. X2 = Len(UserVorName) * 13                                  ' 2nd part
  110. X3 = Len(UserName) * 12                                     ' 3rd part
  111. X4 = "123"                                                  ' 4th part = constant = "123"
  112. X5 = Len(UserName) * Len(UserVorName)                       ' 5th part = lenght(name) * len(vorname)
  113.                                                             ' = 0 if no Vorname
  114. ' this code append all the part together and convert the result to a number
  115. TmpCode = Val(Trim(Str(X1) & Str(X2) & Str(X3) & Str(X4) & Str(X5)))
  116. FirstCharOfName = Asc(UserName) ' FirstCharOfName = ascii value of the first char of the name
  117. If (FirstCharOfName < 65) Or (FirstCharOfName > 90 And FirstCharOfName < 97) Or (FirstCharOfName > 122) Then
  118.     Code = 0 'if the first char is different from A to Z or a to z
  119.     Code = TmpCode * magic(Name1.Text) 'final code = temp code * magic value
  120. End If
  121. Code.Caption = Code 'display code
  122. End Sub
  123. 'here is the function that get the magic value
  124. Public Function magic(Name_of_user As String) As Integer
  125. Name_of_user = UCase(Name_of_user)  ' name in uppercase
  126. magic_string = "17EA071d2c0c3f161a1f0d604A2F49204711521C6259362D4922"   ' i got it with SoftIce and the help of Smartcheck
  127. PlaceOfMagicValue = Asc(Name_of_user) - 65  ' 0 if 'A', 1 if 'B', 2 if 'C'...
  128. Hex_Magic = Mid$(magic_string, PlaceOfMagicValue * 2 + 1, 2) 'get the magic value in hexa
  129. magic = Val(Trim("&H" & Hex_Magic)) ' convert the magic value to decimal
  130. End Function
  131.